package com.tanhua.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.dubbo.api.db.DimensionApi;
import com.tanhua.dubbo.api.mapper.DimensionMapper;
import com.tanhua.model.db.Dimension;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Classname DimensionApiImpl
 * @Description
 * @Version 1.0.0
 * @Date 2021/12/28 11:01
 * @Created by zk
 */
@DubboService
public class DimensionApiImpl implements DimensionApi {

    @Autowired
    private DimensionMapper dimensionMapper;

    @Override
    public Dimension findByType(String maxType) {
        // 查出类型对应的 Dimension对象
        QueryWrapper<Dimension> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("dimension_type", maxType);
        return dimensionMapper.selectOne(queryWrapper);
    }
}